package com.xxh.dataaccess.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * (Category)表实体类
 *
 * @author makejava
 * @since 2021-01-31 23:19:23
 */
@SuppressWarnings("serial")
@Data
public class Category extends Model<Category> {
    //类型id
    @TableId(type = IdType.AUTO)
    private Integer cid;
    //类型名字
    private String name;
    //展示等级
    private Integer level;
    //父类id
    private Integer parentId;
    //该分类下的视频数目
    private Integer videoCount;
    //是否展示该分类
    private Object showStatus;

    //子类别
    @TableField(exist = false)
    List<Category> children;


    public Integer getCid() {
        return cid;
    }

    public void setCid(Integer cid) {
        this.cid = cid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public Integer getVideoCount() {
        return videoCount;
    }

    public void setVideoCount(Integer videoCount) {
        this.videoCount = videoCount;
    }

    public Object getShowStatus() {
        return showStatus;
    }

    public void setShowStatus(Object showStatus) {
        this.showStatus = showStatus;
    }

    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    protected Serializable pkVal() {
        return this.cid;
    }
}